# -*- coding: utf-8 -*-
"""
API密钥配置模板
请将您的真实API密钥填入此文件
"""
import os

# 聚合数据API密钥
# 请访问 https://www.juhe.cn/ 注册并申请API
JUHE_FLIGHT_API_KEY = "YOUR_FLIGHT_API_KEY_HERE"  # 机票API密钥
JUHE_TRAIN_API_KEY = "YOUR_TRAIN_API_KEY_HERE"    # 火车票API密钥

# 高德地图API密钥
GAODE_API_KEY = "YOUR_GAODE_API_KEY_HERE"  # 高德地图API密钥

# DeepSeek AI API密钥
DEEPSEEK_API_KEY = "YOUR_DEEPSEEK_API_KEY_HERE"  # DeepSeek AI API密钥

# 其他API密钥
OTHER_API_KEYS = {
    "baidu": "YOUR_BAIDU_API_KEY_HERE",
    "tencent": "YOUR_TENCENT_API_KEY_HERE"
}

def get_api_key(service: str) -> str:
    """获取API密钥"""
    keys = {
        'juhe_flight': JUHE_FLIGHT_API_KEY,
        'juhe_train': JUHE_TRAIN_API_KEY,
        'gaode': GAODE_API_KEY,
        'deepseek': DEEPSEEK_API_KEY
    }
    
    return keys.get(service, "")

def check_api_keys():
    """检查API密钥配置"""
    print("🔍 检查API密钥配置...")
    
    required_keys = [
        ('juhe_flight', '聚合数据机票API'),
        ('juhe_train', '聚合数据火车票API'),
        ('gaode', '高德地图API'),
        ('deepseek', 'DeepSeek AI API')
    ]
    
    missing_keys = []
    
    for key_name, description in required_keys:
        key_value = get_api_key(key_name)
        if not key_value or key_value.startswith('YOUR_'):
            missing_keys.append(f"❌ {description} ({key_name})")
        else:
            print(f"✅ {description} 已配置")
    
    if missing_keys:
        print("\n⚠️  缺少以下API密钥：")
        for key in missing_keys:
            print(f"  {key}")
        print("\n请访问以下网站申请API密钥：")
        print("1. 聚合数据：https://www.juhe.cn/")
        print("2. 高德地图：https://lbs.amap.com/")
        print("3. DeepSeek AI：https://platform.deepseek.com/")
    else:
        print("\n✅ 所有API密钥已配置完成！")
    
    return len(missing_keys) == 0

if __name__ == "__main__":
    check_api_keys()